package com.sharemarking.application.common.entity;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

import com.sharemarking.application.common.BaseEntity;

@Entity
@Table(name="sys_share")
public class Share extends BaseEntity {
	
	private String describe1;
	private String photo;
	@DateTimeFormat(pattern="yyyy-mm-dd")
	private Date shareTime;
	private String imgUrl;
	private Integer times;
	
	//分享者
	@ManyToOne
	@JoinColumn(name="employeeId")
	private Employee employee;
	
	@OneToMany(cascade={CascadeType.REMOVE},mappedBy = "topic_id")
	@OrderBy(value="createDate asc")  
	private Set<Comment> comment;
	
	public Set<Comment> getComment() {
		return comment;
	}
	public void setComment(Set<Comment> comment) {
		this.comment = comment;
	}
	
	public Employee getEmployee() {
		return employee;
	}
	public void setEmployee(Employee employee) {
		this.employee = employee;
	}
	 
	public String getDescribe1() {
		return describe1;
	}
	public void setDescribe1(String describe1) {
		this.describe1 = describe1;
	}
	public String getPhoto() {
		return photo;
	}
	public void setPhoto(String photo) {
		this.photo = photo;
	}
	public Date getShareTime() {
		return shareTime;
	}
	public void setShareTime(Date shareTime) {
		this.shareTime = shareTime;
	}
	public String getImgUrl() {
		return imgUrl;
	}
	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}
	public Integer getTimes() {
		return times;
	}
	public void setTimes(Integer times) {
		this.times = times;
	}
	
	
	
}
